<?php
@require_once("config.php");
$page=$_GET["page"];
$shownum=$_GET["shownum"];
$paixu=$_GET["paixu"];
if($paixu){
    $str="select * from newinfo order by price $paixu limit $page,$shownum";
}else{
    $str="select * from newinfo limit $page,$shownum";
}

$result=mysql_query($str);

$list=array();
while($item=mysql_fetch_array($result)){
    $temp=array();
    $temp["id"]=$item["id"];
    $temp["goodsname"]=$item["goodsname"];
    $temp["price"]=$item["price"];
    $temp["smallimg"]=$item["smallimg"];
    $list[]=$temp;
}

echo json_encode($list); 

?>